const http = require('http');

const server = http.createServer();

server.on('request', (req, res) => {
    console.log('请求方式：', req.method);
    console.log('HTTP协议版本', req.httpVersion);
    console.log('请求URL：', req.url);

    console.log('请求头信息：', req.headers);

    res.end('hello');
});

server.listen(8888);
